﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using VLUSM_BusinessLogic;
using VLUSM_BusinessLogic.DataTransferObjects;
using Microsoft.Practices.Unity;
using System.Collections.ObjectModel;

namespace VLUSM_Service
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "CatalogueService" in code, svc and config file together.
    public class CatalogueService : ICatalogueService
    {
        IUnityContainer container;
        CatalogueManager manager;

        public CatalogueService()
        {
            container = new UnityContainer();
            manager = container.Resolve<CatalogueManager>();
        }

        #region DVHCCap1 Services
        public ObservableCollection<DVHCCap1DTO> GetDVHCCap1List()
        {
            return manager.GetDVHCCap1List();
        }

        public DVHCCap1DTO GetDVHCCap1ByID(int IDFilter)
        {
            return manager.GetDVHCCap1ByID(IDFilter);
        }

        public DVHCCap1DTO GetDVHCCap1ByTen(string TenFilter)
        {
            return manager.GetDVHCCap1ByTen(TenFilter);
        }

        public DVHCCap1DTO GetDVHCCap1ByMaDonVi(string MaDonViFilter)
        {
            return manager.GetDVHCCap1ByMaDonVi(MaDonViFilter);
        }

        public DVHCCap1DetailDTO GetDVHCCap1DetailByID(int IDFilter)
        {
            return manager.GetDVHCCap1DetailByID(IDFilter);
        }

        public void SaveDVHCCap1(DVHCCap1DTO objdto)
        {
            manager.SaveDVHCCap1(objdto);
        }

        public void SaveDVHCCap1List(ObservableCollection<DVHCCap1DTO> dtolist)
        {
            manager.SaveDVHCCap1List(dtolist);
        }

        public void RemoveDVHCCap1(DVHCCap1DTO objdto)
        {
            manager.RemoveDVHCCap1(objdto);
        }

        public void RemoveDVHCCap1(int IDFilter)
        {
            manager.RemoveDVHCCap1ByID(IDFilter);
        }
        #endregion

        #region DVHCCap2 Services
        public ObservableCollection<DVHCCap2DTO> GetDVHCCap2List()
        {
            return manager.GetDVHCCap2List();
        }

        public ObservableCollection<DVHCCap2DTO> GetDVHCCap2ListByDVHCCap1ID(int IDFilter)
        {
            return manager.GetDVHCCap2ListByDVHCCap1ID(IDFilter);
        }

        public ObservableCollection<DVHCCap2DTO> GetDVHCCap2ListByDVHCCap1MaDonVi(string MaDonViFilter)
        {
            return manager.GetDVHCCap2ListByDVHCCap1MaDonVi(MaDonViFilter);
        }

        public ObservableCollection<DVHCCap2DTO> GetDVHCCap2ListByDVHCCap1Ten(string TenFilter)
        {
            return manager.GetDVHCCap2ListByDVHCCap1Ten(TenFilter);
        }

        public DVHCCap2DTO GetDVHCCap2ByID(int IDFilter)
        {
            return manager.GetDVHCCap2ByID(IDFilter);
        }

        public DVHCCap2DTO GetDVHCCap2ByMaDonVi(string MaDonViFilter)
        {
            return manager.GetDVHCCap2ByMaDonVi(MaDonViFilter);
        }

        public void SaveDVHCCap2(DVHCCap2DTO objdto)
        {
            manager.SaveDVHCCap2(objdto);
        }

        public void SaveDVHCCap2List(ObservableCollection<DVHCCap2DTO> dtolist)
        {
            manager.SaveDVHCCap2List(dtolist);
        }

        public void RemoveDVHCCap2(DVHCCap2DTO objdto)
        {
            manager.RemoveDVHCCap2(objdto);
        }

        public void RemoveDVHCCap2(int IDFilter)
        {
            manager.RemoveDVHCCap2ByID(IDFilter);
        }

        #endregion

        #region ChinhSach Methods
        public ObservableCollection<ChinhSachDTO> GetChinhSachList()
        {
            return manager.GetChinhSachList();
        }

        public ChinhSachDTO GetChinhSachByID(int IDFilter)
        {
            return manager.GetChinhSachByID(IDFilter);
        }

        public ChinhSachDTO GetChinhSachByTen(string TenFilter)
        {
            return manager.GetChinhSachByTen(TenFilter);
        }

        public void SaveChinhSach(ChinhSachDTO objdto)
        {
            manager.SaveChinhSach(objdto);
        }

        public void SaveChinhSachList(ObservableCollection<ChinhSachDTO> dtolist)
        {
            manager.SaveChinhSachList(dtolist);
        }

        public void RemoveChinhSach(ChinhSachDTO objdto)
        {
            manager.RemoveChinhSach(objdto);
        }

        public void RemoveChinhSachByID(int IDFilter)
        {
            manager.RemoveChinhSachByID(IDFilter);
        }
        #endregion

        #region DanToc Services
        public ObservableCollection<DanTocDTO> GetDanTocList()
        {
            return manager.GetDanTocList();
        }

        public DanTocDTO GetDanTocByID(int IDFilter)
        {
            return manager.GetDanTocByID(IDFilter);
        }

        public DanTocDTO GetDanTocByTen(string TenFilter)
        {
            return manager.GetDanTocByTen(TenFilter);
        }

        public void SaveDanToc(DanTocDTO objdto)
        {
            manager.SaveDanToc(objdto);
        }

        public void SaveDanTocList(ObservableCollection<DanTocDTO> dtolist)
        {
            manager.SaveDanTocList(dtolist);
        }

        public void RemoveDanToc(DanTocDTO objdto)
        {
            manager.RemoveDanToc(objdto);
        }

        public void RemoveDanToc(int IDFilter)
        {
            manager.RemoveDanTocByID(IDFilter);
        }
        #endregion

        #region TonGiao Services
        public ObservableCollection<TonGiaoDTO> GetTonGiaoList()
        {
            return manager.GetTonGiaoList();
        }

        public TonGiaoDTO GetTonGiaoByID(int IDFilter)
        {
            return manager.GetTonGiaoByID(IDFilter);
        }

        public TonGiaoDTO GetTonGiaoByTen(string TenFilter)
        {
            return manager.GetTonGiaoByTen(TenFilter);
        }


        public void SaveTonGiao(TonGiaoDTO objdto)
        {
            manager.SaveTonGiao(objdto);
        }

        public void SaveTonGiaoList(ObservableCollection<TonGiaoDTO> dtolist)
        {
            manager.SaveTonGiaoList(dtolist);
        }

        public void RemoveTonGiao(TonGiaoDTO objdto)
        {
            manager.RemoveTonGiao(objdto);
        }

        public void RemoveTonGiao(int IDFilter)
        {
            manager.RemoveTonGiaoByID(IDFilter);
        }
        #endregion

        #region LoaiVanBang Services
        public ObservableCollection<LoaiVanBangDTO> GetLoaiVanBangList()
        {
            return manager.GetLoaiVanBangList();
        }

        public LoaiVanBangDTO GetLoaiVanBangByID(int IDFilter)
        {
            return manager.GetLoaiVanBangByID(IDFilter);
        }

        public LoaiVanBangDTO GetLoaiVanBangByTen(string TenFilter)
        {
            return manager.GetLoaiVanBangByTen(TenFilter);
        }


        public void SaveLoaiVanBang(LoaiVanBangDTO objdto)
        {
            manager.SaveLoaiVanBang(objdto);
        }

        public void SaveLoaiVanBangList(ObservableCollection<LoaiVanBangDTO> dtolist)
        {
            manager.SaveLoaiVanBangList(dtolist);
        }

        public void RemoveLoaiVanBang(LoaiVanBangDTO objdto)
        {
            manager.RemoveLoaiVanBang(objdto);
        }

        public void RemoveLoaiVanBang(int IDFilter)
        {
            manager.RemoveLoaiVanBangByID(IDFilter);
        }
        #endregion

        #region LoaiThayDoi Methods
        public ObservableCollection<LoaiThayDoiDTO> GetLoaiThayDoiList()
        {
            return manager.GetLoaiThayDoiList();
        }

        public LoaiThayDoiDTO GetLoaiThayDoiByID(int IDFilter)
        {
            return manager.GetLoaiThayDoiByID(IDFilter);
        }

        public LoaiThayDoiDTO GetLoaiThayDoiByTen(string TenFilter)
        {
            return manager.GetLoaiThayDoiByTen(TenFilter);
        }
        #endregion

        #region HoatDongDoanThe Services
        public ObservableCollection<HoatDongDoanTheDTO> GetHoatDongDoanTheList()
        {
            return manager.GetHoatDongDoanTheList();
        }

        public HoatDongDoanTheDTO GetHoatDongDoanTheByID(int IDFilter)
        {
            return manager.GetHoatDongDoanTheByID(IDFilter);
        }

        public HoatDongDoanTheDTO GetHoatDongDoanTheByTen(string TenFilter)
        {
            return manager.GetHoatDongDoanTheByTen(TenFilter);
        }

        public void SaveHoatDongDoanThe(HoatDongDoanTheDTO objdto)
        {
            manager.SaveHoatDongDoanThe(objdto);
        }

        public void SaveHoatDongDoanTheList(ObservableCollection<HoatDongDoanTheDTO> dtolist)
        {
            manager.SaveHoatDongDoanTheList(dtolist);
        }

        public void RemoveHoatDongDoanThe(HoatDongDoanTheDTO objdto)
        {
            manager.RemoveHoatDongDoanThe(objdto);
        }

        public void RemoveHoatDongDoanThe(int IDFilter)
        {
            manager.RemoveHoatDongDoanTheByID(IDFilter);
        }
        #endregion

        #region CauLacBo Services
        public ObservableCollection<CauLacBoDTO> GetCauLacBoList()
        {
            return manager.GetCauLacBoList();
        }

        public CauLacBoDTO GetCauLacBoByID(int IDFilter)
        {
            return manager.GetCauLacBoByID(IDFilter);
        }

        public CauLacBoDTO GetCauLacBoByTen(string TenFilter)
        {
            return manager.GetCauLacBoByTen(TenFilter);
        }

        public void SaveCauLacBo(CauLacBoDTO objdto)
        {
            manager.SaveCauLacBo(objdto);
        }

        public void SaveCauLacBoList(ObservableCollection<CauLacBoDTO> dtolist)
        {
            manager.SaveCauLacBoList(dtolist);
        }

        public void RemoveCauLacBo(CauLacBoDTO objdto)
        {
            manager.RemoveCauLacBo(objdto);
        }

        public void RemoveCauLacBo(int IDFilter)
        {
            manager.RemoveCauLacBoByID(IDFilter);
        }
        #endregion

        #region DonVi Services
        public ObservableCollection<DonViDTO> GetDonViList()
        {
            return manager.GetDonViList();
        }

        public DonViDTO GetDonViByID(int IDFilter)
        {
            return manager.GetDonViByID(IDFilter);
        }

        public DonViDTO GetDonViByTen(string TenFilter)
        {
            return manager.GetDonViByTen(TenFilter);
        }

        public ObservableCollection<DonViDTO> GetDonViListByCapTruong()
        {
            return manager.GetDonViListByCapTruong();
        }

        public ObservableCollection<DonViDTO> GetDonViListByCapDonVi()
        {
            return manager.GetDonViListByCapDonVi();
        }

        public void SaveDonVi(DonViDTO objdto)
        {
            manager.SaveDonVi(objdto);
        }

        public void SaveDonViList(ObservableCollection<DonViDTO> dtolist)
        {
            manager.SaveDonViList(dtolist);
        }

        public void RemoveDonVi(DonViDTO objdto)
        {
            manager.RemoveDonVi(objdto);
        }

        public void RemoveDonVi(int IDFilter)
        {
            manager.RemoveDonViByID(IDFilter);
        }
        #endregion

        #region KhoaHoc Services
        public ObservableCollection<KhoaHocDTO> GetKhoaHocList()
        {
            return manager.GetKhoaHocList();
        }

        public KhoaHocDTO GetKhoaHocByID(int IDFilter)
        {
            return manager.GetKhoaHocByID(IDFilter);
        }

        public KhoaHocDTO GetKhoaHocByTen(string TenFilter)
        {
            return manager.GetKhoaHocByTen(TenFilter);
        }
        public KhoaHocDTO GetKhoaHocByNamNhapHoc(int NamNhapHocFilter)
        {
            return manager.GetKhoaHocByNamNhapHoc(NamNhapHocFilter);
        }
        public void SaveKhoaHoc(KhoaHocDTO objdto)
        {
            manager.SaveKhoaHoc(objdto);
        }

        public void SaveKhoaHocList(ObservableCollection<KhoaHocDTO> dtolist)
        {
            manager.SaveKhoaHocList(dtolist);
        }

        public void RemoveKhoaHoc(KhoaHocDTO objdto)
        {
            manager.RemoveKhoaHoc(objdto);
        }

        public void RemoveKhoaHoc(int IDFilter)
        {
            manager.RemoveKhoaHocByID(IDFilter);
        }
        #endregion

        #region Lop Services
        public ObservableCollection<LopDTO> GetLopList()
        {
            return manager.GetLopList();
        }

        public ObservableCollection<LopDTO> GetLopListByDonViID(int DonViIDFilter)
        {
            return manager.GetLopListByDonViID(DonViIDFilter);
        }

        public ObservableCollection<LopDTO> GetLopListByKhoaHocID(int KhoaHocIDFilter)
        {
            return manager.GetLopListByKhoaHocID(KhoaHocIDFilter);
        }

        public ObservableCollection<LopDTO> GetLopListByDonViandKhoaHocID(int DonViIDFilter, int KhoaHocIDFilter)
        {
            return manager.GetLopListByDonViandKhoaHocID(DonViIDFilter, KhoaHocIDFilter);
        }

        public LopDTO GetLopByID(int IDFilter)
        {
            return manager.GetLopByID(IDFilter);
        }

        public LopDTO GetLopByTen(string TenFilter)
        {
            return manager.GetLopByTen(TenFilter);
        }

        public LopDTO GetLopByMalop(string MaLopFilter)
        {
            return manager.GetLopByMaLop(MaLopFilter);
        }

        public void SaveLop(LopDTO objdto)
        {
            manager.SaveLop(objdto);
        }

        public void SaveLopList(ObservableCollection<LopDTO> dtolist)
        {
            manager.SaveLopList(dtolist);
        }

        public void RemoveLop(LopDTO objdto)
        {
            manager.RemoveLop(objdto);
        }

        public void RemoveLopByID(int IDFilter)
        {
            manager.RemoveLopByID(IDFilter);
        }
        #endregion

        #region MonHoc Services
        public ObservableCollection<MonHocDTO> GetMonHocList()
        {
            return manager.GetMonHocList();
        }

        //public ObservableCollection<MonHocDTO> GetMonHocListByNhomNguoiDung(string NhomNguoiDungFilter)
        //{
        //    using (var repo = container.Resolve<MonHocRepository>())
        //    {
        //        var result = repo.GetAllByNhomNguoiDung(NhomNguoiDungFilter);
        //        return Converter.ConvertToMonHocDTOList(result);
        //    }
        //}

        public MonHocDTO GetMonHocByID(int IDFilter)
        {
            return manager.GetMonHocByID(IDFilter);
        }

        public MonHocDTO GetMonHocByMaMonHoc(string MaMonHocFilter)
        {
            return manager.GetMonHocByMaMonHoc(MaMonHocFilter);
        }

        public MonHocDTO GetMonHocByTen(string TenFilter)
        {
            return manager.GetMonHocByTen(TenFilter);
        }


        public void SaveMonHoc(MonHocDTO objdto)
        {
            manager.SaveMonHoc(objdto);
        }

        public void SaveMonHocList(ObservableCollection<MonHocDTO> dtolist)
        {
            manager.SaveMonHocList(dtolist);
        }

        public void RemoveMonHoc(MonHocDTO objdto)
        {
            manager.RemoveMonHoc(objdto);
        }

        public void RemoveMonHoc(int IDFilter)
        {
            manager.RemoveMonHocByID(IDFilter);
        }
        #endregion
    }
} 
